﻿CREATE TABLE applicant (
	applicant_id INT IDENTITY CONSTRAINT pk_applicant_id PRIMARY KEY (applicant_id) NOT NULL,
	surname_txt NVARCHAR(100) NULL,
	name_txt NVARCHAR(100) NULL,
	middle_name_txt NVARCHAR(100) NULL,
	kind_of_activity_id INT CONSTRAINT fk_kind_of_activity_id4 FOREIGN KEY (kind_of_activity_id)
						REFERENCES kind_of_activity (kind_of_activity_id) NOT NULL,
	place_of_residence NVARCHAR(300) NULL
)
GO

CREATE TABLE skills_of_applicant (
	skill_id INT CONSTRAINT fk_skill_id2 FOREIGN KEY (skill_id)
			 REFERENCES skill (skill_id) NOT NULL,
	applicant_id INT CONSTRAINT fk_applicant_id FOREIGN KEY (applicant_id)
			   REFERENCES applicant (applicant_id) NOT NULL

)
GO

ALTER TABLE skills_of_applicant ADD CONSTRAINT pk_skills_of_applicant_id PRIMARY KEY (skill_id, applicant_id)